<?php

/**
 * LlamadaProgramada form base class.
 *
 * @method LlamadaProgramada getObject() Returns the current form's model object
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseLlamadaProgramadaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'empresa_id'      => new sfWidgetFormInputText(),
      'usuario_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Usuario'), 'add_empty' => false)),
      'agente_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Agente'), 'add_empty' => false)),
      'turno_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Turno'), 'add_empty' => false)),
      'llamo_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Llamo'), 'add_empty' => true)),
      'llamada_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Llamada'), 'add_empty' => true)),
      'categoria_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Categoria'), 'add_empty' => true)),
      'fecha'           => new sfWidgetFormDate(),
      'status'          => new sfWidgetFormInputText(),
      'cita_telefonica' => new sfWidgetFormInputText(),
      'nota'            => new sfWidgetFormInputText(),
      'created_at'      => new sfWidgetFormDateTime(),
      'updated_at'      => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'empresa_id'      => new sfValidatorInteger(array('required' => false)),
      'usuario_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Usuario'))),
      'agente_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Agente'))),
      'turno_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Turno'))),
      'llamo_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Llamo'), 'required' => false)),
      'llamada_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Llamada'), 'required' => false)),
      'categoria_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Categoria'), 'required' => false)),
      'fecha'           => new sfValidatorDate(),
      'status'          => new sfValidatorInteger(array('required' => false)),
      'cita_telefonica' => new sfValidatorInteger(array('required' => false)),
      'nota'            => new sfValidatorPass(array('required' => false)),
      'created_at'      => new sfValidatorDateTime(),
      'updated_at'      => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('llamada_programada[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LlamadaProgramada';
  }

}
